/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kopsox.util.log;

import org.kopsox.comm.message.LoggingMessage;
import org.kopsox.general.priority.LoggingPriority;

/**
 * This is the interface which has to be implemented for Custom Loggers<br>
 * The KopsoxRegistry provides a method to create Loggers<br>
 * Each Logger has to have an constructor with an Class argument or an constructor without an argument<br>
 * 
 * @author Konrad Renner - 28.08.2010
 *
 */
public interface KopsoxLogger {

	/**
	 * Returns if Logging is for the given type enabled or not
	 * 
	 * @param type
	 * @return boolean
	 */
	public boolean isLogEnabeld(final LoggingPriority type);
	
	/**
	 * Writes a Log-Message
	 * 
	 * @param message
	 */
	public void writeLogMessage(final LoggingMessage message);
	
	/**
	 * Starts an log-process (e.g. for a Method)
	 * 
	 * @param messageSender 
	 * @param priority - Priority of the startLog-Message
	 * @return long - System.currentMillis
	 */
	public long startLog(String messageSender, LoggingPriority priority);
	
	/**
	 * Ends an log-process (e.g. for a Method)
	 * 
	 * @param messageSender 
	 * @param priority - Priority of the endLog-Message
	 * @param processStartTime - Milliseconds when the Logging has started
	 */
	public void endLog(String messageSender,LoggingPriority priority,long processStartTime);
}
